public class StringBuilderDemo05 {
    public static void main(String[] args) {
        // 非线程安全 快
        StringBuilder sb = new StringBuilder("99");
        for (int i = 0; i < 100; i++) {
            sb.append(i);
        }
        System.out.println(sb);

        // 线程安全 慢
        StringBuffer sb1 = new StringBuffer();
        for (int i = 0; i < 100; i++) {
            sb1.append(i);
        }
        System.out.println(sb1);
    }

}
